package com.navi.loaddata.utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.apache.commons.dbutils.QueryRunner;

import java.beans.PropertyVetoException;

public class JdbcUtil {
    static ComboPooledDataSource dataSource_ora;
    static {
        try {
            dataSource_ora = new ComboPooledDataSource();
            dataSource_ora.setInitialPoolSize(20);
            dataSource_ora.setMinPoolSize(10);
            dataSource_ora.setMaxPoolSize(50);

            dataSource_ora.setUser("p1rptadm");
            dataSource_ora.setPassword("adm1300");
            dataSource_ora.setDriverClass("oracle.jdbc.driver.OracleDriver");
            dataSource_ora.setJdbcUrl("jdbc:oracle:thin:@//10.50.10.15:1521/edbdb");

        } catch (PropertyVetoException e) {
            e.printStackTrace();
        }
    }

    public static QueryRunner getQueryRunner_ora() {
        QueryRunner queryRunner = new QueryRunner(dataSource_ora);
        return queryRunner;
    }

}
